$(document).ready(function() {
	
	/*$(".autocomplete_input").autocomplete(VIEWBETLIST_AJAX_URL, {
	    extraParams: {
	    	'betInfo.name': function() { return $(".autocomplete_input").val(); }
	    },
	    width: 300,
	    dataType: 'json',
	    selectFirst: false,
	    formatItem: function(item) {
	        return item.name;
	    },
	    parse: function (data) {
			var parsed = [];
			for (var i=0; i < data.betInfoList.length; i++) {
				var betInfo = data.betInfoList[i];
				if (betInfo) {
					parsed[parsed.length] = {
						data: betInfo,
						value: betInfo.betId,
						result: betInfo.name
					};
				}
			}
			return parsed;
		}
	}).result(function(event, item) {
		window.location.href = BET_VIEWBET_URL + "?betInfo.betId=" + item.betId;
	}); */
	
});

function loadBetSuccess(data) {
	var value = new Array();
	if(data.betInfoList != null) {
		$('.autocomplete_output').find('option').remove();
		for(var i = 0; i < data.betInfoList.length; i++) {
			var betInfo = data.betInfoList[i];
			value[i] = betInfo.name;
			$('.autocomplete_output').append(
                $('<option></option>').val(betInfo.betId).html(betInfo.name)
            );
		}
	}
	$('.autocomplete_output_container').show();
}

//function doComment(betId) {
//	applyComment(BET, betId, true, true, true);
//	var hscroll = (document.all ? document.scrollLeft : window.pageXOffset);
//	var vscroll = (document.all ? document.scrollTop : window.pageYOffset);
//	$('.comment_component').css('top', vscroll + 10);
//}
//
//function doChooseFriends(betId) {
//	var hscroll = (document.all ? document.scrollLeft : window.pageXOffset);
//	var vscroll = (document.all ? document.scrollTop : window.pageYOffset);
//	$('.sharebet_component').css('top', vscroll + 10);
//	chooseFriends(betId);
//}
	
var color = "white";
function __swap(obj){
	color = obj.style.backgroundColor;
	obj.style.backgroundColor = '#eeeeee';
}
function __reSwap(obj){
	obj.style.backgroundColor = color;
}
function scrollbar(){
	var scrollBorderColor	=	"#7F8E91";
	var scrollFaceColor		=	"#F0F6FF";
	with (document.body.style) {
		scrollbarDarkShadowColor	=	scrollBorderColor;
		scrollbar3dLightColor		=	scrollBorderColor;
		scrollbarArrowColor			=	"black";
		scrollbarBaseColor			=	scrollFaceColor;
		scrollbarFaceColor			=	scrollFaceColor;
		scrollbarHighlightColor		=	scrollFaceColor;
		scrollbarShadowColor		=	scrollFaceColor;
		scrollbarTrackColor			=	"white";
	}			
}
function swapborder(obj) {
	obj.style.border = "0.2cm groove pink";
}
function reSwapborder(obj) {
	obj.style.border = "red";
}
function swap(obj) {
	obj.style.background = "#C9E9FC";
}
function reSwap(obj) {
	obj.style.background = "white";
}